from rest_framework import serializers

from homes.models import House
from orders.models import Order


class OrderSerializer(serializers.ModelSerializer):
    user_id = serializers.IntegerField()
    user = serializers.StringRelatedField(read_only=True)
    # begin_date = serializers.DateField()
    # start_date = begin_date

    class Meta:
        model = Order

        fields = '__all__'
        # fields =['user']


class HouseOrderSerializer(serializers.ModelSerializer):

    class Meta:
        model = House
        fields = '__all__'


class OrderInfoSerializer(serializers.ModelSerializer):

    create_time = serializers.StringRelatedField()
    ctime = create_time


    class Meta:
        model = Order
        fields ='__all__'

